/*
 * @Date: 2022-09-16 09:09:48
 * @LastEditTime: 2022-09-16 09:22:36
 */
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
import { Routes } from './routes'

const createRouter = () => new Router({
  scrollBehavior: () => ({ y: 0 }),
  routes: Routes
})

const router = createRouter()
export function resetRouter () {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
